Prev | Next

Preventing Self-Intersection

<< | >>

Advantages And Limitations

Overview

While the Prevent Self-Intersections parameter can be used in many situations to prevent a flag from penetrating its own surface, it has its limitations. This section discusses when this parameter works best. It also describes this parameter's shortcomings.

How Prevention Works

At each frame, the "Prevention Algorithm" puts a force field around the points in the flag. If a flag point tries to enter the force field, it is pushed away.

NOTE: The Prevention Algorithm does not occur during the Pre-Roll process. Therefore, if a flag is self-intersecting at the first frame after pre-rolling, the Prevention Algorithm may not be able to undo the intersection for that frame. It may also have trouble clearing up the intersections in subsequent frames.

Advantages

There are several scenarios where the Prevent Self-Intersections parameter works well. These mostly involve times when the flag briefly overlaps itself in an animation. Turning on this parameter can usually get rid of the self-intersection without greatly changing the animation itself.

The Prevention Algorithm has many advantages.

  • It's fast.
  • It doesn't change the animation of the flag unless it needs to.
  • It can clean up self-intersections in one area of a flag without modifying the other areas of a flag.
  • It can prevent multiple intersections at once.

In many situations, you won't have to use the Prevent Self-Intersections parameter. A properly undulating flag usually will not intersect itself. But for those times when your animation just won't look right because a flag is intersecting itself, the Prevent Self-Intersections parameter can be used to make your animation look more realistic.

Limitations

While the Prevent Self-Intersections parameter can be used to great effect in many situations, there are scenarios that it may not handle well, such as:

  • Rapidly-moving flags. If the movement between each frame is too great, intersections may still occur.
  • Overly-bunched flags. If your flag folds over itself too many times, there may not be a good way to unfurl it.
  • Once self-intersection does occur, it may stay that way. The Prevention Algorithm cannot usually fix a self-intersection once it happens.

An Ounce Of Prevention Is Worth A Pound Of Cure

The best way for you to avoid creating a flag with self-intersections is to use parameters that won't cause self-intersection in the first place.

If you've tried the Prevent Self-Intersections parameter and it hasn't worked for you situation, you may want to try one of the following solutions. Each of the items below can be used to help you not have self-intersections in the first place.

  • Change the wind speed. A slightly slower or faster wind will change the way a flag flaps.
  • Animate the wind speed. This is especially useful if the flag only self-intersects at a few points in time. By setting a few wind speed keyframes around the time of self-intersection, you may be able to get rid of the intersections without changing the overall wind speed for the animation.
  • Avoid overly-rubbery flags. Loose flags tend to flap about quite a bit. If you can minimize how high the Flag Stretch, Flag Bend, and Flag Shear values are, you may be able to keep your flag flapping in the wind, and not into itself. A higher Conform value may help as well.
  • Keep the mesh size down. Find the minimum Horizontal Mesh and Vertical Mesh values that will suit your needs. An overly-complex mesh will create more folds, and therefore more chances of self-intersection.

The next chapter, Working With Multiple Flags, will discuss ways to make your flags unique. It will also demonstrate how to quickly reuse the animation from one flag to create many animations with different flag images.